package com.ruoyi.project.business.machine.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.business.machine.mapper.YlMachineMapper;
import com.ruoyi.project.business.machine.domain.YlMachine;
import com.ruoyi.project.business.machine.service.IYlMachineService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 售货机Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-04-26
 */
@Service
public class YlMachineServiceImpl implements IYlMachineService 
{
    @Autowired
    private YlMachineMapper ylMachineMapper;

    /**
     * 查询售货机
     * 
     * @param machineId 售货机ID
     * @return 售货机
     */
    @Override
    public YlMachine selectYlMachineById(String machineId)
    {
        return ylMachineMapper.selectYlMachineById(machineId);
    }

    /**
     * 查询售货机列表
     * 
     * @param ylMachine 售货机
     * @return 售货机
     */
    @Override
    public List<YlMachine> selectYlMachineList(YlMachine ylMachine)
    {
        return ylMachineMapper.selectYlMachineList(ylMachine);
    }

    /**
     * 新增售货机
     * 
     * @param ylMachine 售货机
     * @return 结果
     */
    @Override
    public int insertYlMachine(YlMachine ylMachine)
    {
        ylMachine.setCreateTime(DateUtils.getNowDate());
        return ylMachineMapper.insertYlMachine(ylMachine);
    }

    /**
     * 修改售货机
     * 
     * @param ylMachine 售货机
     * @return 结果
     */
    @Override
    public int updateYlMachine(YlMachine ylMachine)
    {
        ylMachine.setUpdateTime(DateUtils.getNowDate());
        return ylMachineMapper.updateYlMachine(ylMachine);
    }

    /**
     * 删除售货机对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYlMachineByIds(String ids)
    {
        return ylMachineMapper.deleteYlMachineByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除售货机信息
     * 
     * @param machineId 售货机ID
     * @return 结果
     */
    @Override
    public int deleteYlMachineById(String machineId)
    {
        return ylMachineMapper.deleteYlMachineById(machineId);
    }
}
